"""
File: tags.py
Author: ershixiong
Date: 2023/12/28
describe:

"""
from hogwarts.WeworkApi.apis.wework import Wework


class Tags(Wework):
    def create(self, data):
        url = 'tag/create'
        pay_load = {
            'method': 'post',
            'url': url,
            'json': data,
        }
        res = self.send(pay_load)
        return res

    def update(self, data):
        url = 'tag/update'
        pay_load = {
            'method': 'post',
            'url': url,
            'json': data,
        }
        res = self.send(pay_load)
        return res

    def list(self):
        url = 'tag/list'
        pay_load = {
            'method': 'get',
            'url': url
        }
        res = self.send(pay_load)
        return res

    def delete(self, id):
        url = 'tag/delete'
        params = {
            'tagid': id
        }
        pay_load = {
            'method': 'get',
            'url': url,
            'params': params,
        }
        res = self.send(pay_load)
        return res
